package com.bilibili.juc.base;

import java.util.concurrent.Callable;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

/**
 * @author zuife
 * @description
 * @since 2024-04-20 12:54:52
 */
public class CompletableFutureDemo {
    public static void main(String[] args) throws ExecutionException, InterruptedException {
        FutureTask<String> futureTask = new FutureTask<>(new MyThread());
        Thread t1=new Thread(futureTask,"t1");
        t1.start();
        System.out.println(futureTask.get());
        CompletableFuture completableFuture = CompletableFuture.supplyAsync(() -> {
            return null;
        });
    }
}
